package com.vision.config;

import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.ClassPathResource;

/**
 * @Filename EhcacheConfig.java
 * @Description
 * @Version 1.0
 * @Author zhongc
 * @Email zhong_ch@foxmail.com
 * @History <li>Author: zhongc</li>
 * <li>Date: 2017/5/31</li>
 * <li>Version: 1.0</li>
 * <li>Content: create</li>
 */
public class EhcacheConfig {

    // /*
    //  * ehcache 主要的管理器
    //  */
    // @Bean(name = "appEhCacheCacheManager")
    // public EhCacheCacheManager ehCacheCacheManager(EhCacheManagerFactoryBean bean){
    //     return new EhCacheCacheManager(bean.getObject ());
    // }
    //
    // /*
    //  * 据shared与否的设置,Spring分别通过CacheManager.create()或new CacheManager()方式来创建一个ehcache基地.
    //  */
    // @Bean
    // public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
    //     EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
    //     cacheManagerFactoryBean.setConfigLocation (new ClassPathResource("conf/ehcache-app.xml"));
    //     cacheManagerFactoryBean.setShared (true);
    //     return cacheManagerFactoryBean;
    // }
}
